<div class="content-table">
    <?php
        echo $this->partial('topo_list.phtml', array(
            'titulo' => $this->titulo,
            'controller' => $this->controller, 
            'search' => $this->search,
            'add'   =>  $this->per_add, 
            'filtro' => TRUE,
            'form_search' => TRUE,
        ));
    ?>
    <table id="tlist" class="tb_content">
        <thead>
            <tr>
                <th></th>
                <th><?php echo tools::ordenacaoTable('Nome','ALU_NOM',$this); ?></th>
                <th><?php echo tools::ordenacaoTable('Turma','CUR_TRM',$this); ?></th>
                <th><?php echo tools::ordenacaoTable('Status','ALU_STA',$this); ?></th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($this->result as $row){ 
                $mat = new Admin_Model_DbTable_Matricula();
                $r_mat = $mat->fetchRow('MAT_STA = 1 AND ALU_ID = ' . $row->ALU_ID);
                
                $cur = new Admin_Model_DbTable_Curso();
                $r_cur = $cur->fetchRow('CUR_STA = 1 AND CUR_ID = ' . (int) $r_mat['CUR_ID']);
            ?>
                <tr>
                    <td width="100px"><img src="<? echo $this->urlfoto.$row->ALU_ID.'.png?'.rand(100,10000); ?>" height="70px" /></td>
                    <td><?php echo $row->ALU_NOM; ?></td>
                    <td><?php echo $r_cur['CUR_TRM']; ?></td>
                    <td><?php echo tools::returnStatusAluno($row->ALU_STA); ?></td>
                    <td>
                        <?php /* if($this->per_del){?><a class="btn-cancel-list" href="javascript:void(0);" onclick="list_delete('<?php echo $this->controller; ?>', <?php echo $row->ALU_ID ?>, $(this));">Deletar</a><?php } */ ?>
                        <?php if($this->per_edt){?><a class="btn-edt-list" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row->ALU_ID)); ?>">Editar</a><?php }?>
                        <?php if($this->per_edt){?><a class="btn-disp-list" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'view', 'id' => $row->ALU_ID)); ?>">Dados</a><?php }?>
                        <?php if($this->per_edt){?><a class="btn-fot-list" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'foto', 'id' => $row->ALU_ID)); ?>">Webcam</a><?php }?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>